package com.itheima.web.controller;


import com.itheima.web.manager.TestSoulManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * java
 */
@RestController
public class TestSoulController {

    @Autowired
    private TestSoulManager testSoulManager;

    @GetMapping("/user/sendSMS")
    public String sendSMS(String telephone) {

        testSoulManager.sendSMS(telephone);

        return "ok";
    }

    @GetMapping("/user/login")
    public String login(Map<String, String> map) {

        String telephone = map.get("telephone");

        String code = map.get("code");

        return testSoulManager.login(telephone, code);
    }
}
